/* const Koa = require('koa')
const app = new Koa()

app.use( async ( ctx ) => {
	ctx.body = 'hello koa2'
})

app.listen(3000) // 访问的端口号

console.log('[demo] start-quick is starting at prot 3000') */

/* async function testAsync(){
	return 'Hello async';
}
const result = testAsync();
console.log(result); */

/* function getSomething(){
	return 'something';
}
async function testAsync(){
	return 'hello'
}
async function test(){
	// await 可以接收 async 的返回值也可以接收普通方法的返回值
	const v1 = await getSomething();
	const v2 = await testAsync();
	console.log(v1,v2);
}
test(); // something hello

async function testAsync2(){
	return 'hello'
}
const result = testAsync2();
console.log(result); //Promise {'hello'} */

/* function takeLongTime() {
	return new Promise(resolve => {
		//这只是一个虚假的，实际项目中多是去后台请求数据，等数据回来后进行执行。
		setTimeout(() => resolve("3秒后打印 long_time_value"), 3000);
	})
}
async function test2(){
	const v = await takeLongTime();
	console.log(v);
}
test2(); */